<?php require_once(dirname(__FILE__).'/inc/config.inc.php');IsModelPriv('member'); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改会员</title>
<link href="templates/style/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="templates/js/jquery.min.js"></script>
<script type="text/javascript" src="templates/js/checkf.func.js"></script>
<script type="text/javascript" src="templates/js/getarea.js"></script>
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="ui/css/bootstrap.min.css">
<link rel="stylesheet" href="ui/css/bootstrap-theme.min.css" >
<script src="ui/js/bootstrap.min.js" ></script>
<script type="text/javascript">

var xmlHttp;



function xmlhttprequest(){

	if(window.ActiveXObject){

		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');

	}

	else if(window.XMLHttpRequest){

		xmlHttp = new XMLHttpRequest();

	}

	else{

		alert('您的浏览器不支持Ajax技术！');

	}

}





//用户名检测

function CheckUser(){

	if(document.form.username.value == ''){

		document.getElementById('usernote').innerHTML = '　';

	}

	else{

		if(document.form.username.value.length < 4){

			document.getElementById('usernote').innerHTML = '<span class="regnotenok">用户名小于4位</span>';

			return;

		}

		xmlhttprequest();

		var username = document.getElementById('username').value;

		var url = "ajax_do.php?"+parseInt(Math.random()*(15271)+1)+'&action=checkuser&username='+username;

		xmlHttp.open("GET", url, true);

		xmlHttp.onreadystatechange = check_done;

		xmlHttp.send(null);

	}

}





function check_done(){

	if(xmlHttp.readyState == 4 && xmlHttp.status == 200){

		document.getElementById('usernote').innerHTML = xmlHttp.responseText;

		if('<span class="regnotenok">用户名已存在</span>' == xmlHttp.responseText){

			document.getElementById('isuser').value = '0';

		}

		else{

			document.getElementById('isuser').value = '';

		}

	}

}

</script>
</head>

<body>
<?php


$row = $dosql->GetOne("SELECT * FROM `#@__user` WHERE `id`=$id");
			//address	
			$address="";
			if($row['country']!=""){
				$address.=$row['country']."-";
			}
			if($row['province']!=""){
				$address.=$row['province']."-";
			}
			if($row['city']!=""){
				$address.=$row['city'];
			}
			
$manage = $dosql->GetOne("SELECT * FROM `#@__manage`  WHERE `uid`=$id");
$manag_info=array();
$has_manage=false;
if(is_array($manage) && isset($manage['id']) ){
	$manag_info=$manage;
	$has_manage=true;
}
?>
<div class="formHeader"> <span class="title">修改会员</span> <a href="javascript:location.reload();" class="reload">刷新</a> </div>
<form name="form" id="form" method="post" action="hzb_manage_save.php" onsubmit="return cfm_addmanage();">
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="formTable">
    <tr>
      <td width="25%" height="40" align="right">用户id：</td>
      <td width="75%"><strong><?php echo $row['id']; ?></strong></td>
    </tr>
    <tr>
      <td width="25%" height="40" align="right">微信昵称：</td>
      <td width="75%"><strong><?php echo $row['nickname']; ?></strong></td>
    </tr>
    <tr>
      <td height="165" align="right">头　像：</td>
      <td><img src="<?php echo $row['headimgurl']; ?>" width="100" /></td>
    </tr>
    <tr>
      <td height="40" align="right">性　别：</td>
      <td><?php if($row['sex'] == '1') echo '男'; else echo '女' ?></td>
    </tr>
    <tr>
      <td height="40" align="right">微信资料地址:</td>
      <td ><?php echo $address; ?></td>
    </tr>
        <tr class="nb">
      <td colspan="2" height="26"><div class="line"></div></td>
    </tr>
    <tr>
      <td height="40" align="right">用户组：</td>
      <td> 翰之博工程师   <span class="label label-danger">翰之博工程师，可以查看所有订单，不受区域限制。</span>
        </td>
    </tr>
    <?php if($has_manage){?>
    
    <tr>
      <td height="40" align="right">公司名称：</td>
      <td ><input class="form-control w300"   type="text"   name="company" id="company" value="翰之博"/></td>
    </tr>
    <tr>
      <td height="40" align="right">工程师姓名：</td>
      <td ><input class="form-control w300"   type="text" name="truename" id="truename" value="<?php echo $manage['truename']?>"/></td>
    </tr>
    <tr>
      <td height="40" align="right">手机：</td>
      <td ><input class="form-control w300"   type="text" name="mobile" id="mobile" value="<?php echo $manage['mobile']?>"/></td>
    </tr>
    <tr>
      <td height="40" align="right">地址：</td>
      <td ><input class="form-control w300"   type="text" name="address" id="address" value="郑州市高新区"/></td>
    </tr>
    <tr class="nb">
      <td colspan="2" height="26"><div class="line"></div></td>
    </tr>
		<tr class="nb">
			<td height="40" align="right">审　核：</td>
			<td><input type="radio" name="checkinfo" value="true" <?php if($manage['checkinfo'] == 'true') echo 'checked="checked"'; ?> />
				是 &nbsp;
				<input type="radio" name="checkinfo" value="false" <?php if($manage['checkinfo'] == 'false') echo 'checked="checked"'; ?> />
				否<span class="cnote">选择"否"则该信息暂时不显示在前台</span></td>
		</tr>
        <input type="hidden" name="action" id="action" value="update" />
  <?php }else{?>
    
    <tr>
      <td height="40" align="right">公司名称：</td>
      <td ><input class="form-control w300"   type="text"   name="company" id="company" value="翰之博"/></td>
    </tr>
    <tr>
      <td height="40" align="right">工程师姓名：</td>
      <td ><input class="form-control w300"   type="text" name="truename" id="truename"/></td>
    </tr>
    <tr>
      <td height="40" align="right">手机：</td>
      <td ><input class="form-control w300"   type="text" name="mobile" id="mobile"/></td>
    </tr>
    <tr>
      <td height="40" align="right">地址：</td>
      <td ><input class="form-control w300"   type="text" name="address" id="address" value="郑州市高新区"/></td>
    </tr>
    		<tr class="nb">
			<td height="40" align="right">审　核：</td>
			<td><input type="radio" name="checkinfo" value="true" checked="checked" />
				是 &nbsp;
				<input type="radio" name="checkinfo" value="false"  />
				否<span class="cnote">选择"否"则该信息暂时不显示在前台</span></td>
		</tr>
    <input type="hidden" name="action" id="action" value="add" />
    
 <?php }?>
  </table>
 
  <div class="formSubBtn">
    <input type="submit" class="btn btn-success" value="提交" />
    <input type="button" class="btn btn-info" value="返回" onclick="history.go(-1);" />
    <input type="hidden" name="id" id="id" value="<?php echo $row['id']; ?>" />
    <input type="hidden" name="openid" id="openid" value="<?php echo $row['openid']; ?>" />
  </div>
</form>
</body>
</html>